<?php
/**
 * 重点参考http://www.cnblogs.com/xiaowu/archive/2012/09/18/2690677.html
 * Enter description here ...
 * @author Administrator
 *
 */
class SocketPush
{
    public $ip = array(
            '10.1.1.106',
            '10.1.1.177',
            '10.1.1.200',
            '10.1.1.128',
            '10.1.1.223',
            '10.1.1.227');
    
    public $port = 9000;
    
    /*推送功能 采用UDP协议 只能单个*/
    public function push($msg)
    {
        
        $len = strlen($msg);
        
        $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
        
        socket_sendto($sock, $msg, $len, 0, '10.1.1.106', $this->port);
        
        socket_close($sock);
    
    }
}
